package com.prompt;


import android.app.Activity;
import android.app.Notification;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent;

public class Tester {

	private Activity  mainActivity;
	private static final int ID_NOTIFICATION = 41821;
	public Tester(Activity  mainActivity){
		this.mainActivity = mainActivity;
	}
	
	public void showNotice(){
		NotificationManager nm = (NotificationManager) mainActivity.getSystemService(Context.NOTIFICATION_SERVICE);
		Notification notification = new Notification();
	    notification.icon = R.drawable.notice1;
	    notification.tickerText = "prompt start提示!";
	    notification.when = System.currentTimeMillis();  
	    
        // 把通知放置在"正在运行"栏目中  
        notification.flags |= Notification.FLAG_ONGOING_EVENT;  
  
          
        Intent intent = new Intent(mainActivity, MainActivity.class);  
        PendingIntent pi = PendingIntent.getActivity(mainActivity, 0, intent, 0);  
  
        notification.setLatestEventInfo(mainActivity, "My Title", "My Content", pi);
        
	    nm.notify(ID_NOTIFICATION, notification);
	}
}
